<?php if (!defined('FLUX_ROOT')) exit; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<?php if (isset($metaRefresh)): ?>
		<meta http-equiv="refresh" content="<?php echo $metaRefresh['seconds'] ?>; URL=<?php echo $metaRefresh['location'] ?>">
		<?php endif ?>
		<title><?php echo Flux::config('SiteTitle'); if (isset($title)) echo ": $title" ?></title>
		<link rel="stylesheet" href="<?php echo $this->themePath('css/flux.css') ?>" type="text/css" media="screen" title="" charset="utf-8" />
		<!--[if IE]>
		<link rel="stylesheet" href="<?php echo $this->themePath('css/flux/ie.css') ?>" type="text/css" media="screen" title="" charset="utf-8" />
		<![endif]-->	
		<!--[if lt IE 7]>
		<script src="<?php echo $this->themePath('js/ie7.js') ?>" type="text/javascript"></script>
		<![endif]-->
		<script type="text/javascript" src="<?php echo $this->themePath('js/jquery-1.2.6.min.js') ?>"></script>
		<!--<script type="text/javascript" src="<?php echo $this->themePath('js/jquery.dropshadow.js') ?>"></script>-->
		<script type="text/javascript" src="<?php echo $this->themePath('js/flux.datefields.js') ?>"></script>
		<script type="text/javascript">
			$(document).ready(function(){
				var inputs = 'input[type=text],input[type=password],input[type=file]';
				$(inputs).focus(function(){
					$(this).css({
						'background-color': '#f9f5e7',
						'border-color': '#dcd7c7',
						'color': '#726c58'
					});
				});
				$(inputs).blur(function(){
					$(this).css({
						'backgroundColor': '#ffffff',
						'borderColor': '#dddddd',
						'color': '#444444'
					}, 500);
				});
				$('.menuitem a').hover(
					function(){
						$(this).fadeTo(200, 0.85);
						$(this).css('cursor', 'pointer');
					},
					function(){
						$(this).fadeTo(150, 1.00);
						$(this).css('cursor', 'normal');
					}
				);
				
				// In: js/flux.datefields.js
				processDateFields();
			});
			
			function reload(){
				window.location.href = '<?php echo $this->url ?>';
			}
		</script>
		
		<?php if ($session->isLoggedIn()): ?>
		<script type="text/javascript">
			function updatePreferredServer(sel){
				var preferred = sel.options[sel.selectedIndex].value;
				document.preferred_server_form.preferred_server.value = preferred;
				document.preferred_server_form.submit();
			}
		</script>
		<?php endif ?>
	</head>
	<body>
		<table cellspacing="0" cellpadding="0" width="100%">
			<tr>
				<!-- Header -->
				<td bgcolor="#8ebceb" width="20"></td>
				<td bgcolor="#8ebceb" colspan="3">
					<a href="<?php echo $this->basePath ?>">
						<img src="<?php echo $this->themePath($session->account->level >= Flux::config('AdminMenuLevel') ? 'img/logo_admin.gif' : 'img/logo.gif') ?>"
							title="<?php echo htmlspecialchars(Flux::config('SiteTitle')) ?>" id="logo" />
					</a>
				</td>
				<td bgcolor="#8ebceb" width="20"></td>
			</tr>
			<tr>
				<!-- Spacing between header and content -->
				<td colspan="3" height="20"></td>
			</tr>
			<tr>
				<td style="padding: 10px"></td>
				<td width="198">
					<!-- Sidebar -->
					<?php include 'main/sidebar.php' ?>
				</td>
				<!-- Spacing between sidebar and content -->
				<td style="padding: 10px"></td>
				<td width="100%">
					<!-- Login box / User information -->
					<?php include 'main/loginbox.php' ?>
					
					<!-- Content -->
					<table cellspacing="0" cellpadding="0" width="100%" id="content">
						<tr>
							<td width="18"><img src="<?php echo $this->themePath('img/content_tl.gif') ?>" style="display: block"  /></td>
							<td bgcolor="#f5f5f5"></td>
							<td width="18"><img src="<?php echo $this->themePath('img/content_tr.gif') ?>" style="display: block" /></td>
						</tr>
						
						<tr>
							<td bgcolor="#f5f5f5"></td>
							<td bgcolor="#f5f5f5">
								<!-- Messages -->
								<?php if ($message=$session->getMessage()): ?>
									<p class="message"><?php echo htmlspecialchars($message) ?></p>
								<?php endif ?>
								
								<!-- Sub menu -->
								<?php include 'main/submenu.php' ?>
								
								<!-- Credit balance -->
								<?php if (in_array($params->get('module'), array('donate', 'purchase'))) include 'main/balance.php' ?>
